/* 额外的样式优化 */

/* 卡片悬停效果增强 */
.module-card:hover .module-number {
    transform: scale(1.1);
    transition: transform 0.3s ease;
}

/* 代码块语法高亮 */
.code-block .keyword {
    color: #ff79c6;
}

.code-block .string {
    color: #f1fa8c;
}

.code-block .comment {
    color: #6272a4;
}

.code-block .function {
    color: #50fa7b;
}

/* 加载动画 */
.loading {
    display: inline-block;
    width: 20px;
    height: 20px;
    border: 3px solid rgba(255, 255, 255, 0.3);
    border-radius: 50%;
    border-top-color: #fff;
    animation: spin 1s ease-in-out infinite;
}

@keyframes spin {
    to { transform: rotate(360deg); }
}

/* 工具提示 */
.tooltip {
    position: relative;
    display: inline-block;
}

.tooltip .tooltiptext {
    visibility: hidden;
    width: 200px;
    background-color: #555;
    color: #fff;
    text-align: center;
    border-radius: 6px;
    padding: 5px;
    position: absolute;
    z-index: 1;
    bottom: 125%;
    left: 50%;
    margin-left: -100px;
    opacity: 0;
    transition: opacity 0.3s;
}

.tooltip:hover .tooltiptext {
    visibility: visible;
    opacity: 1;
}

/* 进度条 */
.progress-bar {
    width: 100%;
    height: 8px;
    background-color: #e0e0e0;
    border-radius: 4px;
    overflow: hidden;
    margin: 10px 0;
}

.progress-fill {
    height: 100%;
    background: linear-gradient(90deg, #667eea, #764ba2);
    border-radius: 4px;
    transition: width 0.3s ease;
}

/* 标签样式 */
.tag {
    display: inline-block;
    background: #667eea;
    color: white;
    padding: 4px 8px;
    border-radius: 12px;
    font-size: 0.8rem;
    margin: 2px;
}

.tag.feature {
    background: #28a745;
}

.tag.advanced {
    background: #ffc107;
    color: #333;
}

.tag.basic {
    background: #17a2b8;
}

/* 统计卡片 */
.stats-grid {
    display: grid;
    grid-template-columns: repeat(auto-fit, minmax(200px, 1fr));
    gap: 1rem;
    margin: 2rem 0;
}

.stat-card {
    background: white;
    padding: 1.5rem;
    border-radius: 10px;
    text-align: center;
    box-shadow: 0 2px 10px rgba(0, 0, 0, 0.1);
}

.stat-number {
    font-size: 2rem;
    font-weight: bold;
    color: #667eea;
    margin-bottom: 0.5rem;
}

.stat-label {
    color: #666;
    font-size: 0.9rem;
}

/* 响应式表格 */
.table-responsive {
    overflow-x: auto;
    margin: 1rem 0;
}

table {
    width: 100%;
    border-collapse: collapse;
    background: white;
    border-radius: 10px;
    overflow: hidden;
    box-shadow: 0 2px 10px rgba(0, 0, 0, 0.1);
}

th, td {
    padding: 12px;
    text-align: left;
    border-bottom: 1px solid #e9ecef;
}

th {
    background: #667eea;
    color: white;
    font-weight: 600;
}

tr:hover {
    background: #f8f9fa;
}

/* 搜索框 */
.search-container {
    margin: 2rem 0;
    text-align: center;
}

.search-box {
    width: 100%;
    max-width: 400px;
    padding: 12px 20px;
    border: 2px solid #e9ecef;
    border-radius: 25px;
    font-size: 1rem;
    outline: none;
    transition: border-color 0.3s ease;
}

.search-box:focus {
    border-color: #667eea;
    box-shadow: 0 0 0 3px rgba(102, 126, 234, 0.1);
}

/* 返回顶部按钮 */
.back-to-top {
    position: fixed;
    bottom: 30px;
    right: 30px;
    width: 50px;
    height: 50px;
    background: #667eea;
    color: white;
    border: none;
    border-radius: 50%;
    cursor: pointer;
    display: none;
    align-items: center;
    justify-content: center;
    font-size: 1.2rem;
    box-shadow: 0 2px 10px rgba(0, 0, 0, 0.2);
    transition: all 0.3s ease;
    z-index: 1000;
}

.back-to-top:hover {
    background: #5a6fd8;
    transform: translateY(-2px);
}

.back-to-top.show {
    display: flex;
}

/* 深色模式支持 */
@media (prefers-color-scheme: dark) {
    .features, .quick-start {
        background: #2d3748;
        color: #e2e8f0;
    }
    
    .modules, .learning-path {
        background: #1a202c;
        color: #e2e8f0;
    }
    
    .feature-card, .module-card, .path-content {
        background: #4a5568;
        color: #e2e8f0;
        border-color: #718096;
    }
    
    .section-title {
        color: #e2e8f0;
    }
}

/* JavaScript控制的深色主题 */
body.dark-theme {
    background: #1a202c;
    color: #e2e8f0;
}

body.dark-theme .navbar {
    background: rgba(45, 55, 72, 0.95);
    backdrop-filter: blur(10px);
}

body.dark-theme .nav-links a {
    color: #e2e8f0;
}

body.dark-theme .nav-links a:hover {
    color: #81e6d9;
}

body.dark-theme .features,
body.dark-theme .quick-start {
    background: #2d3748;
    color: #e2e8f0;
}

body.dark-theme .modules,
body.dark-theme .learning-path {
    background: #1a202c;
    color: #e2e8f0;
}

body.dark-theme .feature-card,
body.dark-theme .module-card,
body.dark-theme .path-content {
    background: #4a5568;
    color: #e2e8f0;
    border-color: #718096;
}

body.dark-theme .section-title {
    color: #e2e8f0;
}

body.dark-theme .stat-card {
    background: #4a5568;
    color: #e2e8f0;
}

body.dark-theme .stat-label {
    color: #a0aec0;
}

body.dark-theme .code-block {
    background: #1a202c;
    color: #e2e8f0;
}

body.dark-theme .footer {
    background: #1a202c;
}

body.dark-theme .search-box {
    background: #4a5568;
    color: #e2e8f0;
    border-color: #718096;
}

body.dark-theme .search-box:focus {
    border-color: #81e6d9;
    box-shadow: 0 0 0 3px rgba(129, 230, 217, 0.1);
}

/* 深色主题下的按钮样式 */
body.dark-theme .btn-primary {
    background: #81e6d9;
    color: #1a202c;
}

body.dark-theme .btn-primary:hover {
    background: #4fd1c7;
    box-shadow: 0 5px 15px rgba(129, 230, 217, 0.4);
}

body.dark-theme .btn-secondary {
    background: rgba(129, 230, 217, 0.2);
    color: #e2e8f0;
    border-color: rgba(129, 230, 217, 0.3);
}

body.dark-theme .btn-secondary:hover {
    background: rgba(129, 230, 217, 0.3);
}

/* 深色主题下的主题切换按钮 */
body.dark-theme .theme-toggle {
    background: #81e6d9;
    color: #1a202c;
}

body.dark-theme .theme-toggle:hover {
    background: #4fd1c7;
    transform: translateY(-2px);
}

/* 主题切换按钮悬停效果 */
.theme-toggle:hover {
    background: #5a6fd8;
    transform: translateY(-2px);
    box-shadow: 0 5px 15px rgba(102, 126, 234, 0.4);
}

/* 打印样式 */
@media print {
    .navbar, .footer, .back-to-top {
        display: none;
    }
    
    .main-content {
        margin-top: 0;
    }
    
    .hero {
        background: white !important;
        color: black !important;
    }
}
